package com.tianma.demo.service.impl;

import com.tianma.demo.dao.ProductDao;
import com.tianma.demo.model.Product;
import com.tianma.demo.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductDao productDao;
    /**
     * 获取产品
     * @param id
     * @return
     */
    public Product getProduct(Long id) {
        return productDao.getProduct(id);
    }

    public int decreaseProduct(Long id, int quantity) {
        return productDao.decreaseProduct(id, quantity);
    }
}
